package com.example.demo99.common;

import com.example.demo99.Enums.OrderStatus;

import java.util.*;

public class OrderStatusFlow {
    public static final Map<OrderStatus, List<OrderStatus>> FLOW;

    static {
        Map<OrderStatus, List<OrderStatus>> map = new HashMap<>();
        map.put(OrderStatus.PENDING_PAYMENT, Arrays.asList(OrderStatus.PAID, OrderStatus.CANCELED));
        map.put(OrderStatus.PAID, Arrays.asList(OrderStatus.DELIVERING, OrderStatus.RETURNING));
        map.put(OrderStatus.DELIVERING, Collections.singletonList(OrderStatus.COMPLETED));
        map.put(OrderStatus.RETURNING, Collections.singletonList(OrderStatus.RETURNED));
        FLOW = Collections.unmodifiableMap(map);
    }
}
